projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa73db2
)
libxenlight: returns errors if xc and/or xs has not been initialized properly.
author
Keir Fraser
<keir.fraser@citrix.com>
Fri, 8 Jan 2010 11:45:34 +0000
(11:45 +0000)
committer
Keir Fraser
<keir.fraser@citrix.com>
Fri, 8 Jan 2010 11:45:34 +0000
(11:45 +0000)
fixed segfault when xenstore or xc are not available.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/libxl/libxl.c
patch
|
blob
|
history
diff --git
a/tools/libxl/libxl.c
b/tools/libxl/libxl.c
index 8194623bf6810e5625214a68ccc7d720f61cdaec..a49371540cb97ba7a27ff312f1d8989de425dd8c 100644
(file)
--- a/
tools/libxl/libxl.c
+++ b/
tools/libxl/libxl.c
@@
-45,7
+45,17
@@
int libxl_ctx_init(struct libxl_ctx *ctx, int version)
return ERROR_NOMEM;
ctx->xch = xc_interface_open();
+ if (ctx->xch == -1) {
+ free(ctx->alloc_ptrs);
+ return ERROR_FAIL;
+ }
+
ctx->xsh = xs_daemon_open();
+ if (!ctx->xsh) {
+ xc_interface_close(ctx->xch);
+ free(ctx->alloc_ptrs);
+ return ERROR_FAIL;
+ }
return 0;
}